<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'“神州通”蓄电池运行能力管理系统',
	'language'=>'zh_cn',
	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.modules.user.models.*',
		'application.modules.user.components.*',
		'application.modules.rights.*',
		'application.modules.rights.components.*',
		'application.modules.helpers.EDownloadHelper',
		'application.modules.vendors.PHPExecl',
		'application.modules.ehttpclient.*',
		'application.modules.ehttpclient.adapter.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		
		'gii'=>array(
			'class'=>'application.modules.gii.GiiModule',
			'password'=>'123456',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1','192.168.6.149'),
		),
		
		'user'=>array(
            'hash' => 'md5',
            'sendActivationMail' => false,
            'loginNotActiv' => false,
            'activeAfterRegister' => false,
            'autoLogin' => true,
            'registrationUrl' => array('/user/registration'),
            'recoveryUrl' => array('/user/recovery'),
            'loginUrl' => array('/user/login'),
            'returnUrl' => array('/site/index'), 
            'returnLogoutUrl' => array('/user/login'),
			'captcha' => array('registration'=>false),
			'sendActivationMail' => false,
        ),
		
		'rights'=>array(
			'install' => false,
		),
	),

	// application components
	'components'=>array(
		'authManager'=>array(
			'class'=>'RDbAuthManager',
			//'connectionID'=>'db',
			'defaultRoles'=>array('Authenticated', 'Guest'),
        ),
		'user'=>array(			
			// enable cookie-based authentication
			'class'=>'RWebUser',
			'allowAutoLogin'=>true,
			'loginUrl' => array('/user/login'),
		),
		// uncomment the following to enable URLs in path-format
		/*
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),		
		'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		),
		*/
		// uncomment the following to use a MySQL database
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=battery',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '123456',
			'charset' => 'utf8',
			'tablePrefix' => 'tbl_'
		),
		/*
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=testdrive',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),
		*/
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'jichu'=>array(
			array('label'=>'制造商信息','url'=>array('/dictManufacturer/admin'),'itemOptions'=>array('class'=>'icons maker')),
			array('label'=>'电池类型','url'=>array('/dictBatterySort/admin'),'itemOptions'=>array('class'=>'icons types')),
			array('label'=>'电池规格','url'=>array('/dictBattery/admin'),'itemOptions'=>array('class'=>'icons spec')),
			array('label'=>'站点类型','url'=>array('/btstype/admin'),'itemOptions'=>array('class'=>'icons battery')),
			array('label'=>'电池组类型','url'=>array('/mtsysBasetype/admin'),'itemOptions'=>array('class'=>'icons mold')),			
//			array('label'=>'设备管理','url'=>array('/deviceMonitor/admin'),'itemOptions'=>array('class'=>'icons machine')),
		),
		'yunying'=>array(
			array('label'=>'站点信息','url'=>array('/mtsysBase/admin'),'itemOptions'=>array('class'=>'icons station')),
			array('label'=>'电池组管理','url'=>array('/btBattery/admin'),'itemOptions'=>array('class'=>'icons battery')),
			array('label'=>'导入检测数据','url'=>array('/uploadFiles/admin'),'itemOptions'=>array('class'=>'icons database')),
			array('label'=>'参数设置','url'=>array('/setting/admin'),'itemOptions'=>array('class'=>'icons mold')),
			array('label'=>'设备管理','url'=>array('/sensors/admin'),'itemOptions'=>array('class'=>'icons machine')),
		),
		'tongji'=>array(
			array('label'=>'运行分类报表','url'=>array('/btBatterys/admin'),'itemOptions'=>array('class'=>'icons chart')),
		),
		'system'=>array(
			array('label'=>'单位管理','url'=>array('/unit/admin'),'itemOptions'=>array('class'=>'icons org')),
			array('label'=>'用户管理','url'=>array('/user/admin'),'itemOptions'=>array('class'=>'icons users')),
			array('label'=>'权限配置','url'=>array('/rights/'),'itemOptions'=>array('class'=>'icons power')),
			
		),
		'help'=>array(
			array('label'=>'帮助详情','url'=>array('/helper/admin'),'itemOptions'=>array('class'=>'icons help')),
			array('label'=>'系统意见簿','url'=>array('/suggestion/admin'),'itemOptions'=>array('class'=>'icons suggest')),
		),
	),
	
	
);
